package org.anno.chunkdb;

/**
 * Evaluates the result of {@link java.util.Comparator#compare}.
 */
enum DiffPredicate {
  LT {
    boolean apply(int diff) {
      return diff < 0;
    }
  }, LE {
    boolean apply(int diff) {
      return diff <= 0;
    }
  }, EQ {
    boolean apply(int diff) {
      return diff == 0;
    }
  }, GE {
    boolean apply(int diff) {
      return diff >= 0;
    }
  }, GT {
    boolean apply(int diff) {
      return diff > 0;
    }
  };

  abstract boolean apply(int diff);
}
